import java.sql.*;

public class TestSPCall {
	public static void main(String[] args) throws Exception {
			
		Connection connection = DriverManager.getConnection(Constants.DB_URL, Constants.USER, Constants.PASSWORD);
		CallableStatement spStatement = connection.prepareCall("call CountAllOrdersSum(?, ?)");
		spStatement.setString(1, "Shipped");
		spStatement.registerOutParameter(2, Types.DOUBLE);
		spStatement.execute();
		
		System.out.print("Sum of all shipped orders: ");
		System.out.println(spStatement.getDouble(2));
		
		connection.close();
	}
}
